package operation.modules.operation.controller;

import operation.modules.operation.entity.MainTextEntity;
import operation.modules.operation.service.WelcomeService;
import operation.util.ReqResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 欢迎页面 控制层
 */
@RestController
@RequestMapping("api/welcome")
public class WelcomeController {
    private final Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private WelcomeService welcomeService;

    /**
     * 查询所有
     */
    @RequestMapping("/main-text")
    public ReqResult queryAllMainText() {
        logger.info("欢迎页面 查询所有数据");
        List<MainTextEntity> list = welcomeService.queryAll();
        return ReqResult.ok().put("list", list);
    }

}